#include "stdafx.h"


    namespace network
    {

        void SBSessionManager::start(sb_session_ptr s)
        {
            m_sessions.insert(s);
            s->start();
        }

        void SBSessionManager::stop(sb_session_ptr s)
        {
            m_sessions.erase(s);
            s->stop();
        }

        void SBSessionManager::stop_all()
        {
            // For each connexion in the set, we call the stop function without parameters
            std::for_each(m_sessions.begin(), m_sessions.end(), boost::bind(&Session::stop
                                                                            , _1));

            // We can clear the set now
            m_sessions.clear();
        }

    } //  //	namespace network
